﻿using System.Data;

namespace MingYuanYun.Data.Abstractions
{
    internal static class ConnectionProvider
    {
        internal static IDbConnection GetConnection(Driver driver, string connectionString)
        {
            // 需要 config <system.data><DbProviderFactories>
            //var connection = DbProviderFactories.GetFactory(connectionStringSetting.ProviderName).CreateConnection();
            //connection.ConnectionString = connectionStringSetting.ConnectionString;
            //return connection;

            return DriverProvider.GetDriver(driver).CreateConnection(connectionString);
        }
    }
}
